﻿
$(document).ready(function () {

    // load cookie
    //fix height on div tree view

    kendo.culture("vi-VN");

    var height_conntent_splitter = $(window).height() - 80;
    $("#splitter").css({ "height": height_conntent_splitter });

    $("#splitter").kendoSplitter({
        panes: [
            { collapsible: true, size: "200px" },
            { collapsible: false }
        ]
    });

    $("#panelbar").kendoPanelBar({
        expandMode: "single"
    }).css({ width: "180px" }).css({ margin: "0px auto" });

    $(window).resize(function () {
        resizeSplitter()
    });

   

});

function confirmOptionNormal(texts) {
    $.confirm({
        text: texts,
        confirm: function (button) {
        },
        cancel: function (button) {

        }
    });
}

function resizeSplitter() {

    var height_conntent_splitter = $(window).height() - 80;
    $("#splitter").css({ "height": height_conntent_splitter });

};

function loadwindowOnContent(url, elements, title, width, height) {

    var window_currently = $("<div></div>");
    window_currently.appendTo("body").addClass("dialog_window").attr("id", elements);

    window_currently.kendoWindow({
        actions: ["Close"],
        draggable: true,
        height: height,
        modal: true,
        //pinned: false,
        content: url,
        resizable: true,
        title: title,
        width: width,
        close: function () {
            this.destroy();
            this.close();
        }
    }).data("kendoWindow").center().open();
}

function close_window(elements) {
    var data_window = $(".dialog_window").data("kendoWindow");
    data_window.close();
    data_window.destroy();
}

function makeloadingForm() {
    $("#content_load_mast_form").mask("Dữ liệu đang xử lý...");
}